package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.UserDAO;
import cn.nebula.music.domain.User;


@Component
public class StringToUserConverter implements Converter<String,User>{

	@Autowired
	private UserDAO userDAO;
	
	@Override
	public User convert(String source) {
		return userDAO.findUserById(Integer.valueOf(source));
	}

}
